package com.jp.knowledge.view;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

/**
 * Created by jiayen on 16/9/27.
 */
public class CommViewPage extends ViewPager {
    public CommViewPage(Context context) {
        super(context);
    }

    public CommViewPage(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    private boolean swapSwitchEnable = true;
    public void setSwapSwitchEnable(boolean enable){
        swapSwitchEnable = enable;
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        if (swapSwitchEnable)
            return super.onInterceptTouchEvent(ev);
        else
            return false;
    }
}
